﻿
@{
    ViewBag.Title = "Set password";
}

<h2>Set password</h2>

<hr />

@Html.Partial("_Details")

<br /><br />

<form id="form" class="form-horizontal" method="post" role="form"
      data-bv-message="This value is not valid"
      data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
      data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
      data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
    <div class="form-group">
        @Html.ValidationSummary(false, null, new { @class = "col-sm-offset-1 text-danger" })
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">New password</label>
        <div class="col-sm-4">
            <input name="NewPassword" class="form-control" type="password" maxlength="20"
                   required data-bv-notempty-message="The new password is required and cannot be empty"
                   data-bv-stringlength="true"
                   data-bv-stringlength-min="6"
                   data-bv-stringlength-max="20"
                   data-bv-stringlength-message="The password must be at least 6 and not more than 20 characters long" />
        </div>
        <div class="col-sm-2">
            <input type="submit" class="btn btn-primary" value="Submit" />
            <input type="button" class="btn btn-info" value="Return" onclick="javascript:history.go(-1)" />
        </div>
    </div>
</form>

<div style="clear:both"></div>

@section scripts
{
    <script>
        $(document).ready(function () {
            $.getJSON('/Data?name=user', {}, function (data, textStatus, jqXHR) {
                $('#details').renderer(data);
            });

            $('#form').bootstrapValidator();
        });
    </script>
}